package com.example.controller;

import com.example.service.InventoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/inventory")
public class InventoryController {

    @Autowired
    private InventoryService inventoryService;

    @GetMapping("/decreInventory.do")
    public String decreInventory(){
        System.out.println("inventory decre success....");
        return "success";
    }
    @GetMapping("/deduct.do")
    public Boolean deduct(String commodityCode, Integer count) {
        return inventoryService.deduct(commodityCode, count);
    }
}